﻿using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace MicroShop.Entity.System
{
    /// <summary>
    /// 系统角色表
    /// </summary>  
    [Table("t_sys_role"), Description("系统角色表"), Serializable]
    public class SysRolePO
    {
        /// <summary>
        /// 角色编号
        /// </summary>        
        [Column("id"), Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public long Id { get; set; } = 0L;

        /// <summary>
        /// 租户编号
        /// </summary>
        [Column("tenant_id"), Description("租户编号"), DefaultValue(0L)]
        public long TenantId { get; set; } = 0L;

        /// <summary>
        /// 角色名称
        /// </summary>
        [Column("role_name"), Description("角色名称"), DefaultValue("运营人员")]      
        public string RoleName { get; set; } = string.Empty;

        /// <summary>
        /// 角色级别
        /// </summary>
        [Column("role_level"), Description("角色级别"), DefaultValue(1)]
        public int RoleLevel { get; set; } = 1;

        /// <summary>
        /// 上级角色Id
        /// </summary>
        [Column("parent_id"), Description("上级角色Id"), DefaultValue(0L)]
        public long ParentId { get; set; } = 0L;

        /// <summary>
        /// 是否启用：false-否；true-是
        /// </summary>
        [Column("is_enable"), Description("是否启用"), DefaultValue(true)]
        public bool IsEnable { get; set; } = true;

        /// <summary>
        /// 描述
        /// </summary>
        [Column("description"), Description("描述"), DefaultValue("")]      
        public string Description { get; set; } = string.Empty;

        /// <summary>
        /// 删除标记：false-否；true-是
        /// </summary>
        [Column("is_deleted"), Description("是否删除"), DefaultValue(false)]
        public bool IsDeleted { get; set; } = false;

        /// <summary>
        /// 创建时间
        /// </summary>
        [Column("create_time"), Description("创建时间"), DefaultValue("2020-01-01 00:00:00")]
        public DateTime CreateTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 创建者
        /// </summary>
        [Column("create_by"), Description("创建者"), DefaultValue("系统")]
        public string CreateBy { get; set; } = string.Empty;

        /// <summary>
        /// 更新时间
        /// </summary>
        [Column("update_time"), Description("更新时间"), DefaultValue("2020-01-01 00:00:00")]
        public DateTime UpdateTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 更新者
        /// </summary>
        [Column("update_by"), Description("更新者"), DefaultValue("系统")]
        public string UpdateBy { get; set; } = string.Empty;
               
    }
}
